<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6.css"/>
<![endif]-->
<link rel="stylesheet" type="text/css"  href="../../../../public/layui/css/layui.css">
<link href="../../../../public/admin/css/style_v2.0.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/style_v2.0.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
</head>
<body>
<div class="position mt10">当前位置：<a href="{:U('Index/main')}">后台首页</a> > 外地网站</div>
<div id="container">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>外地网站</legend>
</fieldset>
<div class="layui-form" >
   <div class="layui-btn-group">
      <a href="{:U('Admin/Web/waidi/')}" class="layui-btn layui-btn-big"><i class="layui-icon">&#xe60a;</i> 外地网站</a>
    </div>
   <div class="layui-btn-group" style="float:right;">
      <button data-method="notice" class="layui-btn layui-btn-big" ><i class="layui-icon">&#xe654;</i>  添加新域名</button>
      <a href="{:U('web/export/')}"  class="layui-btn layui-btn-big layui-btn-normal"><i class="layui-icon">&#xe62d;</i> 导出报表</a>
</div>
<div class="hselect mt10" style="background-color:#FFFFFF;">
    <form name='search' action="{:U('Admin/Web/search')}" enctype="multipart/form-data" method="post"  class="layui-form">
    <span>高级搜索：</span>
    <div id="keyword"><input name="keyword" type="text" id="keyword"  value="" placeholder="请输入关键词" autocomplete="off" class="layui-input"></div>
    
    <div class="hselect_box" style="width:120px;">
     <select name="group" lay-verify="" lay-filter="">
          <option value="">选择所在分组</option>
          <volist name="group" id="g">
          <option value="{$g.gid}">{$g.groupname}</option>
          </volist>
        </select>
    </div>
    <div class="hselect_box" style="width:120px;">
     <select name="account" lay-verify="">
           <option value="">域名所属账号</option>
           <volist name="account" id="a">
           <option value="{$a.aid}">{$a.aname}</option>
           </volist>
           <option value="0">域名不在我处</option>
        </select>
    </div>
    <span>到期时间:</span>
    <div class="hselect_box" style="width:120px;">
         <input name="dstart" type="text" value=""  placeholder="开始日" class="layui-input ico-date" id="dstart">
    </div>
    <span style="padding-right:10px">-</span>
    <div class="hselect_box" style="width:120px;">
    <input name="dend" type="text"  value=""  placeholder="结束日"  class="layui-input ico-date" id="dend">
    </div>
    <div class="hselect_box"><button class="layui-btn layui-btn-primary" style=" margin-top:-4px;" lay-submit lay-filter="formSearch">立即提交</button></div>
    </form>
    <div class="c"></div>
</div>
</div>
<!--高级搜索-->
<div class="c"></div>
<div class="layui-form" >
<table class="layui-table" id="table">
    <thead>
    <tr style="text-align:center;">
      <th tyle="text-align:center;">&nbsp;</th>
      <th>域名</th>
      <th>网站名称</th>
      <th>联系人</th>
      <th>状态</th>
      <th>联系方式</th>
      <th>域名账号</th>
      <th>完成时间</th>
      <th>管理权</th>
      <th colspan="2" align="center">操作</th>
    </tr> 
    </thead>
    <form id="form2" name="form2" method="post" action="{:U('Admin/Web/waidi_del/')}">  
     <volist name="list" id="r">
    <tr>
      <td  align="center" class="layui-form-item"><input type="checkbox" title="{$r.wid}" id="wid[]"  lay-skin="primary"  name="wid[]" value="{$r.wid}" /></td>
      <td align="center" height="22px">{$r.weburl}&nbsp;<a href="{$r.weburl}" target="_blank"><font color="#009688">[访问]</font></a></td>
      <td align="center" height="22px">{$r.webname}</td>
      <td align="center" height="22px"><a href="{:U('Web/search',array('group' => $r['gid']))}">{$r.contact}</a></td>
      <td><if condition="$r['status'] eq 0"><font color="red">已过期</font><else /><font color="009688">正常</font></if></td>
      <td id="endtime">{$r.contactinfo}</td>
      <td style="max-width:200px;">{$r.domaininfo}</td>
      <td>{$r.finishtime|date='Y-m-d', ###}</td>
      <td><if condition="$r['status'] eq 0"><font color="red">无权</font><else /><font color="009688">管理</font></if></td>
      <td  align="center">
         <div class="layui-btn-group">
          <a href="{:U('Admin/Web/waidi_edit/',array('wid' => $r['wid']))}"  title="编辑" class="layui-btn layui-btn-small"><i class="layui-icon">&#xe642;</i></a><a href="{:U('Admin/Web/waid_del',array('wid' => $r['wid']))}" class="layui-btn layui-btn-small layui-btn-danger" title="删除" onClick="return checkConfirm('您确认删除记录?')"><i class="layui-icon">&#xe640;</i></a>
          </div>
      </td>
    </tr>
    </volist>
    <tr>
      <td align="center"><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></td>
      <td colspan="8">
      <div style="padding-left:20px;">  
         <input type="button" value="全选" name="selectall" class="layui-btn" />
         <input type="button" value="反选" name="selectno" class="layui-btn "/>
         <button  name="btnDel" lay-submit="" lay-filter="btnDel" class="layui-btn layui-btn-danger" />删除</button>
      </div>      </td>
      <td align="center">&nbsp;</td>
    </tr>
   </form>
    </table>
    </div>
    <div class="c"></div>
    <div id="pages">{$page}</div>      

</div>
</body>
</html>
<form name=reg action="{:U('Admin/Web/waidi_update')}"  enctype="multipart/form-data"  method="post"  class="layui-form" id="waidi_add" style="display:none;">
<div class="layui-form">
    <table class="layui-table">
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>网站域名：</td>
	  <td width="80%">
      <span class="table_span" style="width:300px; float:left;"><input name="weburl" type="text" id="weburl" value="" required  lay-verify="" placeholder="网站域名" autocomplete="off" class="layui-input"></span>
      <span class="table_txt"></span>
      </td>
    </tr>
    <tr>
	  <td width="20%" align="right"><font color=red size="1">·</font>网站名称：</td>
	  <td width="80%">
      <span class="table_span" style="width:300px; float:left;"><input name="webname" type="text" id="webname" value=""  lay-verify="" placeholder="网站名称" autocomplete="off" class="layui-input"></span>
      <span class="table_txt"></span>
      </td>
    </tr>
    <tr>
	  <td width="20%" align="right">联系人：</td>
	  <td width="80%">
      <span class="table_span" style="width:300px; float:left;"><input name="contact" type="text" id="contact" value=""  lay-verify="" placeholder="联系人" autocomplete="off" class="layui-input"></span>
      <span class="table_txt"></span>
      </td>
    </tr>
    <tr>
	  <td align="right">联系人信息：</td>
	  <td><span class="table_span" style="width:300px; float:left;"><textarea name="contactinfo" type="text" id="contactinfo" value=""  lay-verify="" placeholder="联系人信息" autocomplete="off" class="layui-textarea" style="height:60px;"></textarea></span>
      </td>
    </tr>
     <tr>
	  <td align="right">域名账号信息：</td>
	  <td><span class="table_span" style="width:300px; float:left;"><textarea name="domaininfo" type="text" id="domaininfo" value=""  lay-verify="" placeholder="域名账号信息" autocomplete="off" class="layui-textarea" style="height:60px;"></textarea></span>
      </td>
    </tr>
    <tr>
	  <td align="right">FTP信息：</td>
	  <td><span class="table_span" style="width:300px; float:left;"><textarea name="ftpinfo" type="text" id="ftpinfo" value=""  lay-verify="" placeholder="FTP信息" autocomplete="off" class="layui-textarea" style="height:60px;"></textarea></span>
      </td>
    </tr>
    <tr>
	  <td align="right">其他信息：</td>
	  <td><span class="table_span" style="width:300px; float:left;"><textarea name="other" type="text" id="other" value=""  lay-verify="" placeholder="其他信息" autocomplete="off" class="layui-textarea" style="height:60px;"></textarea></span>
      </td>
    </tr>
    <tr>
	   <td align="right"><font color=red size="1">·</font>完成时间：</td>
	  <td><input name="finishtime" type="text" id="finishtime" value="{$now|date='Y-m-d',###}"  autocomplete="off" onClick="layui.laydate({elem: this, istime: true, istoday: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:250px; float:left;"></td>
	  </tr>
     <tr>
	   <td align="right"><font color=red size="1">·</font>有无管理权：</td>
	  <td><input type="radio" name="ismanage" value="1"  lay-filter="ismanage" title="有权限" checked > &nbsp;&nbsp;&nbsp; <input type="radio" name="ismanage" value="0" title="无权限"  lay-filter=""></td>
	  </tr>
    <tr>
	     <td align="right">排序：</td>
	     <td><span class="table_txt"><input type="text" name="listorder" value="0" class="layui-input" style="width:50px;"></span>
            <span class="table_txt"><font color="#666666">（越大越靠前）</font></span></td>
        </tr>
     <tr>
	   <td align="right"><font color=red size="1">·</font>添加时间：</td>
	  <td><input name="inputtime" type="text" id="inputtime" value="{$now|date='Y-m-d',###}"  autocomplete="off" onClick="layui.laydate({elem: this, istime: true, istoday: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date"  style="width:250px; float:left;"></td>
	  </tr>
    <tr> 
	  <td colspan=2 align="center" valign="middle">
		<input type="submit" name="Submit" value="确&nbsp; &nbsp;定" class="layui-btn" >
		<input type="reset" name="Submit2" value="重　置" class="layui-btn layui-btn-primary" >		 </td>
	</tr>
    </table>
</div>
</form>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script>
layui.use(['form','laydate'], function(){
  var form = layui.form;
  var laydate = layui.laydate;
  var active = {
       notice: function(){
		  layer.open({
			type: 1
			,title: '新增外地网站' //不显示标题栏
			,closeBtn: 2
			,area: ['700px','600px']
			,shade: 0.4
			,id: 'LAY_layuipro' //设定一个id，防止重复弹出
			//,btn: ['提交', '关闭']
			,btnAlign: 'c'
			,moveType: 1 //拖拽模式，0或者1
			,content: $("#waidi_add"),
            })
       }	 
   };
   $('.layui-btn-group .layui-btn').on('click', function(){
		var othis = $(this), method = othis.data('method');
		active[method] ? active[method].call(this, othis) : '';
  });
  
   laydate.render({
    elem: '#finishtime'
	,type: 'date'
  });
  
   laydate.render({
       elem:'#inputtime'
	   ,type:'date'
   });
   
   form.verify({
        price_min: [/\d*$/, '必须是数字']
	   ,price_max: function(value){
	       if(value != ""){
			   if(!new RegExp(/^\d*$/).test(value)){
		            return '必须是数字0';
		       }
			   if(value < $("#price_min").val()){
			       return '价格范围填写错误';
			   }
		   }else{
		      //layer.msg(value));
		   }
	   }
   });
   
  //监听提交
  form.on('submit(formSearch)', function(data){
    //layer.msg(JSON.stringify(data.field));
	title: '最终的提交信息'
	return true;
  });

});
</script>